package com.day0422.AnimalTest;/*
 * @创建者：黄苟苟
 * @创建时间：2021/4/23   14:43
 * @Description描述
 **/

public class Animal {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Animal() {
    }
    public void cry(){
        System.out.println("我是谁，我要怎么叫");
    }

    public void eat() {
        System.out.println("我是谁，我不知道吃什么");
    }
}
class Dog extends Animal{
    @Override
    public void cry() {
        System.out.println("我是苟苟，我会汪汪叫");
        }

    @Override
    public void eat() {
        System.out.println("我是苟苟，我爱吃骨头");
    }
}
class Cat extends Animal{
    @Override
    public void cry() {
        System.out.println("我是加菲猫，我会喵喵叫");
    }

    @Override
    public void eat() {
        System.out.println("我是加菲猫，我爱吃鱼");
    }
}